package cn.xudy.top.dao.Impl;

import cn.xudy.top.dao.MainDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by Ulegal on 2017/11/7.
 */
@Repository
public class MainDaoImpl implements MainDao{


    @Autowired
    JdbcTemplate jdbcTemplate;

    @Override
    public List<Map<String, Object>> getInfo() {

        // 传统方法
        List<Map<String,Object>> list = new ArrayList<Map<String, Object>>();
        String  sql  =   "SELECT * FROM " + "Table_1" +";";
        list = jdbcTemplate.queryForList(sql);
        System.out.println("-------------"+list);

        return null;
    }



}



















